#include "../globals/globals.h"

void gyro_reset() { imu.resetRotation(); }
const double actual_1_rev_gyro_value = 364; //转一圈陀螺仪的实际数值
double get_gyro() { return imu.rotation() / actual_1_rev_gyro_value * 360; }

//根据陀螺仪按照方向需要调整
// z轴倒着装，需要取反
double get_gyro_rate() {
  return imu.gyroRate(axisType::zaxis, velocityUnits::dps);
}

double get_pitch() { return imu.roll(); }
double get_pitch_rate() {
  return (-imu.gyroRate(axisType::xaxis, velocityUnits::dps));
}
